/*
Hermes Core: General Purpose Mobile Agent Platform
Copyright (C) 2006 UNICAM - Università degli Studi di Camerino

Group leaders: Flavio Corradini and Emanuela Merelli

Developers: Ezio Bartocci, Diego Bonura, Rosario Culmone,
Davide Lorenzoli, Leonardo Mariani, Francesca Piersigilli, 
Lorenzo Scortichini, Leonardo Vito.

GNU Lesser Public License

This library is free software; you can redistribute it 
and/or modify it under the terms of the GNU Lesser General 
Public License as published by the Free Software Foundation, 
version 2.1 of the License.

This library is distributed in the hope that it will be useful, 
but WITHOUT ANY WARRANTY; without even the implied warranty of 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public 
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.

Emanuela Merelli
Dipartimento di Matematica ed Informatica
Università di Camerino
via Madonna delle Carceri, 62032 Camerino, Italy
E.Mail: emanuela.merelli@unicam.it
*/
package hermesV2.agent;

import java.io.Serializable;

/**
 * @author diegobonura
 * @author leonardovito
 * 
 * The single Interaction of a protocol.
 *  
 */
public class Interaction implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 213448237368157716L;

	/**
     * The name of the interaction.
     */
    private String name;

    /**
     * The action name of the interaction.
     */
    private String action;
    
    /**
     * The type of the interaction.
     */
    private String type;

    /**
     * The array of all parameter names of the interaction.
     */
    private String[] parameterNames;

    /**
     * The array of all parameter types of the interaction.
     */
    private Class<?>[] parameterTypes;


    /**
     * The constructor of a single interaction.
     * @param name The interaction name.
     * @param action The action name of the interaction.
     * @param type The type of the interaction.
     * @param parameterNames The array of all parameter names of the interaction.
     * @param parameterTypes The array of all parameter types of the interaction.
     */
    public Interaction(String name, String action, String type, String[] parameterNames, Class<?>[] parameterTypes){
        this.name = name;
        this.action = action;
        this.type = type;
        this.parameterNames = parameterNames;
        this.parameterTypes = parameterTypes;

    }

    /**
     * The contructor of a single interaction whitout parameters.
     * @param name The interaction name.
     * @param action The action name of the interaction.
     * @param type The type of the interaction.
     */
    public Interaction(String name, String action, String type)  {
        this(name,action,type,new String[0],new Class[0]);
    }
    /**
     * This method returns the action name of the interaction.
     * @return Returns the action.
     */
    public String getAction() {
        return action;
    }

    /**
     * This method returns the name of the interaction.
     * @return Returns the name.
     */
    public String getName() {
        return name;
    }

    /**
     * This method returns the array of parameter names of the single interaction.
     * @return Returns the parameterNames array.
     */
    public String[] getParameterNames() {
        return parameterNames;
    }

    /**
     * This method returns the array of parameter types of the single interaction.
     * @return Returns the parameterNames array.
     */
    public Class<?>[] getParameterTypes() {
        return parameterTypes;
    }

    /**
     * This method returns the type of the interaction.
     * @return Returns the type.
     */
    public String getType() {
        return type;
    }
}